﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace ConsoleApplication1
{
    public class UserFileInfo : IEquatable<UserFileInfo>
    {
        public FileInfo AllInfo { get; set; }
        public byte[] Md5FileHash { get; set; }



        public bool Equals(UserFileInfo other)
        {
            //наверное сравниваем тока по хэшу.
            if (this.Md5FileHash != null)
            {
                return this.Md5FileHash.SequenceEqual<byte>(other.Md5FileHash);
            }
            else
            {
                return (this.AllInfo.Name == other.AllInfo.Name);
            }

        }
        public override string ToString()
        {
            return this.AllInfo.Name;
        }



    }

}
